package com.scm.biz.service;

import java.util.List;

import org.springframework.web.multipart.MultipartFile;

import com.scm.biz.bean.BusinessFile;
import com.scm.core.bean.exp.UfdmException;

/**
 * 业务附件类业务类接口
 * @author Young
 * @Date 2016.11.16
 *
 */
public interface BusinessFileService {
	
	/**
	 * 保存用户上传的附件
	 * @param attachs 文件
	 * @param businessId 关联对象的ID
	 * @return 
	 */
	void insertList(List<MultipartFile> attachs, Long businessId,String fileCategory,int flag) throws UfdmException ;
	void insert(MultipartFile multipartFile,Long businessId,String fileCategory,Integer flag) throws UfdmException ;

	int removeById(Long id);
	BusinessFile selectByKey(Long id);
	void update(BusinessFile businessFile);
	int removeByBusinesId(Long businessId,String category);
	/**
	 * 根据业务记录ID，查询附件列表
	 * @param businessId 业务记录ID
	 * @return
	 */
	List<BusinessFile> selectListByBusinessId(Long businessId,String category);
	public void saveCustomer(String attachIds, List<MultipartFile> attachs, int businessId,String fileCategory) throws UfdmException ;
	
	/**
	 * 根据ID，删除客户附件
	 * @param delAttachIds
	 */
	void removeCustomerFile(String delAttachIds);
	
	/**
	 * 保存样衣图片
	 * @param images 图片文件
	 * @param id 样衣ID
	 * @param value 
	 * @param mainImage 主图下标
	 * @param image 主图路径
	 */
	void saveImage(List<MultipartFile> images, Integer id, String category, int mainImage, String image) throws UfdmException;
	
	/**
	 * 查询图片
	 * @param businessId
	 * @param category
	 * @return
	 */
	List<String> getImage(Long businessId,String category);
	
	/**
	 * 复制图片
	 * @param images
	 * @param id
	 * @param category
	 * @param mainImage
	 * @param image
	 * @throws UfdmException
	 */
	void copyImage(List<String> images, Long id, String category, int mainImage, String image) throws UfdmException;
}
